ccd6581b51d4a3bff68d058879df44a0281d2933,liberty-maven-plugin/src/main/java/net/wasdev/wlp/maven/plugins/applications/UndeployAppMojo.java,UndeployAppMojo,doExecute,#,62

Before Change


        undeployTask.setServerName(serverName);
        undeployTask.setUserDir(userDirectory);
        undeployTask.setOutputDir(outputDirectory);
        undeployTask.setFile(appArchive);
        // Convert from seconds to milliseconds
        undeployTask.setTimeout(Long.toString(timeout*1000));
        undeployTask.execute();

After Change


            throw new NullPointerException("Undeploy task not found");
        }
        
        if (appArchive != null || appArtifact != null) {
            
            if (appArchive != null && appArtifact != null) {
                throw new MojoExecutionException(
                        messages.getString("error.app.set.twice"));
            }
            
            if (appArtifact != null) {
                Artifact artifact = getArtifact(appArtifact);
                appArchive = artifact.getFile().getName();
                
                log.info(MessageFormat.format(
                        messages.getString("info.variable.set"),
                        "artifact based application", appArtifact));
                
            } else if (appArchive != null) {
                File file = new File(appArchive);
                if (file.exists()) {
                    appArchive = file.getName();
                }
                
                log.info(MessageFormat.format(
                        messages.getString("info.variable.set"),
                        "non-artifact based application", appArchive));
                
            }
            
            File destFile = new File(serverDirectory, "dropins/" + appArchive);
            if (destFile == null || !destFile.exists()
                    || destFile.isDirectory()) {
                throw new IOException(MessageFormat.format(
                        messages.getString("error.undeploy.app.noexist"),
                        destFile.getCanonicalPath()));
            }
            
            undeployTask.setFile(appArchive);
            log.info(MessageFormat.format(
                    messages.getString("info.undeploy.app"),
                    destFile.getCanonicalPath()));